home *** CD-ROM | disk | FTP | other *** search
/ PD Collection CD 1 / PD Collection CD 1.iso / textual / pdftops / xpdf / h / Catalog < prev    next >
Text File  |  1996-06-08  |  1KB  |  58 lines

  1. //========================================================================
  2. //
  3. // Catalog.h
  4. //
  5. // Copyright 1996 Derek B. Noonburg
  6. //
  7. //========================================================================
  8.  
  9. #ifndef CATALOG_H
  10. #define CATALOG_H
  11.  
  12. #ifdef __GNUC__
  13. //#pragma interface
  14. #endif
  15.  
  16. class Object;
  17. class Page;
  18. class PageAttrs;
  19. class Ref;
  20.  
  21. //------------------------------------------------------------------------
  22. // Catalog
  23. //------------------------------------------------------------------------
  24.  
  25. class Catalog {
  26. public:
  27.  
  28.   // Constructor.
  29.   Catalog(Object *catDict);
  30.  
  31.   // Destructor.
  32.   ~Catalog();
  33.  
  34.   // Is catalog valid?
  35.   GBool isOk() { return ok; }
  36.  
  37.   // Get number of pages.
  38.   int getNumPages() { return numPages; }
  39.  
  40.   // Get a page.
  41.   Page *getPage(int i) { return pages[i-1]; }
  42.  
  43.   // Find a page, given its object ID.  Returns page number, or 0 if
  44.   // not found.
  45.   int findPage(int num, int gen);
  46.  
  47. private:
  48.  
  49.   Page **pages;            // array of pages
  50.   Ref *pageRefs;        // object ID for each page
  51.   int numPages;            // number of pages
  52.   GBool ok;            // true if catalog is valid
  53.  
  54.   int readPageTree(Dict *pages, PageAttrs *attrs, int start);
  55. };
  56.  
  57. #endif
  58.